package cn.wolfcode.wolf2w.query;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 处理游记的高级查询的数据映射问题
 * 描述：前端只带来一个数字值，而后端需要做范围查询
 */
@Getter
public class TravelCondition {
    public static final Map<Integer, TravelCondition> PERSON_EXPEND = new HashMap(); //人均消费的映射值
    public static final Map<Integer, TravelCondition> TRAVEL_DAYS = new HashMap(); //出行天数的映射值
    static {
        /* 1 --- 1-999
         * 2 --- 1K-6K
         * 3 --- 6K-20
         * 4 --- 20K以上*/
        // 人均消费的映射
        PERSON_EXPEND.put(1,new TravelCondition(1, 999));
        PERSON_EXPEND.put(2,new TravelCondition(1000, 6000));
        PERSON_EXPEND.put(3,new TravelCondition(6001, 20000));
        PERSON_EXPEND.put(4,new TravelCondition(20001, Integer.MAX_VALUE));
        // 出行天数的映射值
        /* 1 --- 3天以下
         * 2 --- 4-7天
         * 3 --- 8-14天
         * 4 --- 15天以上*/
        TRAVEL_DAYS.put(1, new TravelCondition(0, 3));
        TRAVEL_DAYS.put(2, new TravelCondition(4, 7));
        TRAVEL_DAYS.put(3, new TravelCondition(8, 14));
        TRAVEL_DAYS.put(4, new TravelCondition(15, Integer.MAX_VALUE));
    }
    private int min;//最小值
    private int max;//最大值
    public TravelCondition(int min, int max){
        this.min = min;
        this.max = max;
    }
}
